package com.boot.web;

import com.boot.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Chunsheng.Zhang
 * @date 2021/4/16 15:57
 * @description : TODO
 */
@RestController
public class LoginController {


    @Autowired
    private RedisUtil redisUtil;


    @RequestMapping("/logoutSuccess")
    public String logoutSuccess(HttpServletRequest request){
        String token = request.getHeader("token");
        redisUtil.del(token);
        return "退出成功！";
    }
}
